Harden release workflow to build and upload deterministic pollenlevels.zip asset#71
Conversation
Summary of ChangesHello @eXPerience83, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the release process for the "Pollen Levels" HACS integration by automating the creation and attachment of a consistent 'pollenlevels.zip' asset to GitHub Releases. This ensures that HACS can accurately track download counts and manage the integration effectively, streamlining release management and improving the reliability of asset distribution. Highlights
Changelog
Ignored Files
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||
There was a problem hiding this comment.
Code Review
The changes to hacs.json correctly configure the integration to use a release asset for HACS installations. By setting zip_release to true and specifying the filename as pollenlevels.zip, the integration will now leverage the deterministic ZIP asset generated by the release workflow. This aligns with the PR's goal of hardening the release process and ensuring accurate download tracking. The configuration follows HACS best practices for asset-based distribution.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 615ab06ba8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| files: pollenlevels.zip | ||
| tag_name: ${{ github.event.release.tag_name || github.ref_name }} |
There was a problem hiding this comment.
Require explicit tag for manual release asset upload
When this workflow is started via workflow_dispatch, github.event.release.tag_name is empty, so tag_name falls back to github.ref_name (typically the branch name, e.g. main). That means manual reruns upload against the wrong release target (or create an unintended release/tag) instead of repairing the published release asset for a real version tag. Add a required dispatch input for the release tag and use that value (or fail fast if no tag is provided).
Useful? React with 👍 / 👎.
User description
Motivation
download_countby automatically attaching a deterministic ZIP namedpollenlevels.zipto each published release.Description
/.github/workflows/release-asset.ymlthat triggers onrelease(types:[published]) andworkflow_dispatchfor manual reruns.contents: write) and a concurrency guardrelease-asset-${{ github.event.release.tag_name || github.ref }}withcancel-in-progress: trueto avoid duplicate uploads.actions/checkout@v5, resolves an archive ref usingrelease.tag_namewith fallback toGITHUB_SHA, and usesgit archiveto producepollenlevels.zipcontaining onlycustom_components/pollenlevels.custom_components/pollenlevels/manifest.jsonis present before uploading withsoftprops/action-gh-release@v2, explicitly targeting the release tag and preserving the exact asset filenamepollenlevels.zip, andhacs.jsoncontains"zip_release": trueand"filename": "pollenlevels.zip"to match HACS expectations.Testing
ruff check --fix --select I .and it completed successfully.ruff check .and it completed successfully.black .and formatting completed with no changes required.Codex Task
PR Type
Enhancement
Description
Automate deterministic ZIP asset creation and upload for GitHub Releases
Configure HACS integration to recognize and track release downloads
Implement concurrency guards and sanity checks for robust retry handling
Diagram Walkthrough
File Walkthrough
release-asset.yml
GitHub Actions workflow for automated release ZIP creation.github/workflows/release-asset.yml
and manual dispatch
tag-based grouping
git archiveto build deterministicpollenlevels.zipcontainingonly
custom_components/pollenlevelsmanifest.jsonpresence before upload
softprops/action-gh-release@v2hacs.json
Configure HACS for release asset download trackinghacs.json
"zip_release": trueflag to enable HACS release asset tracking"filename": "pollenlevels.zip"to specify expected assetfilename for HACS